package jwr.basic;

public class Charge {

	public static void main(String[] args) {
		int pay = 8_7654_3210;
		int price = 0;
		
		int charge = pay-price;
		int a,c;
		a=0;
		c=50000;
		
		System.out.println("받은 돈 : "+ pay+ " 값 : " + price+ " 거스름돈 : "+ charge);
		for(int i=1; i<=8;i++){
			a = charge/c;
			charge = charge-c*a;
			System.out.println(c+"원권 "+a+"개 ");
			if(i%2==1){
				c=c/5;
			}else if(i%2==0){
				c=c/2;
			}
		}
	}
}
